package com.jml.bio;

import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;

public class UdpClient {

	public static void main(String[] args) throws IOException {
		System.out.println("udp客户端启动连接....");
		DatagramSocket ds = new DatagramSocket();
		String str="我是UDP传输的数据";
		byte[] bytes= str.getBytes();
		DatagramPacket dp= new DatagramPacket(bytes, bytes.length,InetAddress.getByName("127.0.0.1"),8080);
		ds.send(dp);
		ds.close();
	}

}
